﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BakalarskaPraca.Generation.Data;
using ColladaDotNet.Geometry;

namespace BakalarskaPraca.Generation.Visualization
{
    public class GeometryTreeNode : TreeNode 
    {
        public ModelGeometry Geometry { get; private set;}
        private readonly List<Polygon> _polygons;
        public GeometryTreeNode(ModelGeometry geometry)
        {
            this.Geometry = geometry;
            this._polygons = new List<Polygon>();
            this.Text = geometry.Name;
            int count = 0;
            this.Geometry.Polygons.ForEach(
                        polygon =>
                            {
                                this.Nodes.Add(new PolygonTreeNode(polygon, "polygon_" + count++));
                                this._polygons.Add(polygon);
                            }
                     );
        } 

        
    }
}
